import React, { Component } from 'react'

export default class Son extends Component {
    // 定义内部状态方式1
    // constructor() {
    //     super()
    //     this.state = {
    //         count: 8888888888888888,
    //         num: 9999999999999999
    //     }
    // }
    // 定义内部状态方式2
    state = {
        count: 888888,
        num: 9999999,
        flag: false
    }
    render() {
        // 通过解构赋
        const { count, num, flag } = this.state
        return (
            <div className='box'>
                {/* Son --- {count}
                <h3>
                    {num}
                </h3> */}
                <h1 className={ flag? 'block': 'none' }>标题</h1>
            </div>
        )
    }
}
